All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.DefaultHighlighter
java.lang.Object
|
+----com.sun.java.swing.text.DefaultHighlighter
- public class DefaultHighlighter
- extends Object
- implements Highlighter
Implements the Highlighter interfaces. Implements a simple highlight
painter that renders in a solid color.
- See Also:
- Highlighter
-
DefaultHighlighter()
- Creates a new DefaultHighlighther object.
-
addHighlight(int, int, Highlighter. HighlightPainter)
- Adds a highlight to the view.
-
changeHighlight(Object, int, int)
- Changes a highlight.
-
deinstall(JTextComponent)
- Called when the UI is being removed from the interface of
a JTextComponent.
-
getHighlights()
- Makes a copy of the highlights.
-
install(JTextComponent)
- Called when the UI is being installed into the
interface of a JTextComponent.
-
paint(Graphics)
- Renders the highlights.
-
removeAllHighlights()
- Removes all highlights.
-
removeHighlight(Object)
- Removes a highlight from the view.
DefaultHighlighter
public DefaultHighlighter()
- Creates a new DefaultHighlighther object.
paint
public void paint(Graphics g)
- Renders the highlights.
- Parameters:
- g - the graphics context
install
public void install(JTextComponent c)
- Called when the UI is being installed into the
interface of a JTextComponent. Installs the editor, and
removes any existing highlights.
- Parameters:
- c - the editor component
- See Also:
- install
deinstall
public void deinstall(JTextComponent c)
- Called when the UI is being removed from the interface of
a JTextComponent.
- Parameters:
- c - the component
- See Also:
- deinstall
addHighlight
public Object addHighlight(int p0,
int p1,
Highlighter. HighlightPainter p) throws BadLocationException
- Adds a highlight to the view. Returns a tag that can be used
to refer to the highlight.
- Parameters:
- p0 - the start offset of the range to highlight >= 0
- p1 - the end offset of the range to highlight >= p0
- p - the painter to use to actually render the highlight
- Returns:
- s an object that can be used as a tag
to refer to the highlight
- Throws: BadLocationException
- if the specified location is invalid
removeHighlight
public void removeHighlight(Object tag)
- Removes a highlight from the view.
- Parameters:
- tag - the reference to the highlight
removeAllHighlights
public void removeAllHighlights()
- Removes all highlights.
changeHighlight
public void changeHighlight(Object tag,
int p0,
int p1) throws BadLocationException
- Changes a highlight.
- Parameters:
- tag - the highlight tag
- p0 - the beginning of the range >= 0
- p1 - the end of the range >= p0
- Throws: BadLocationException
- if the specified location is invalid
getHighlights
public Highlighter. Highlight[] getHighlights()
- Makes a copy of the highlights. Does not actually clone each highlight,
but only makes references to them.
- Returns:
- the copy
- See Also:
- getHighlights
All Packages Class Hierarchy This Package Previous Next Index